<template>
  <div>
    <Header></Header>
    <div class="mt-5">
      <a v-for="item in list" :key="item" @click="jumpToDetail">
        <div class="name-box">
          <div class="img-box mt-1 ms-1"><img :src="item.imgbase64"></div>
          <div class="content">
            <p>{{ item.username }}</p>
            <p>{{ item.updatetime.substring(0, 4) == new Date().getFullYear()
              ? item.updatetime.replace(/^[^-]*-|:[^:]*$/g, '')
              : item.updatetime.replace(/:[^:]*$/g, '') }}</p>
          </div>
        </div>
      </a>
    </div>
  </div>
</template>

<script>
import Header from './components/Header.vue'
export default {
  components: { Header },
  data() {
    return {
      list: null
    }
  },
  mounted() {
    this.initMessageList()
  },
  methods: {
    initMessageList() {
      this.post('qryMessages', {
        pagenum: 1,
        pagesize: 10
      }, { emulateJSON: true }).then((res) => {
        this.list = res.data.data.list
      })
    }
  }
}
</script>

<style></style>
